home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
- Begin VB.Form CompanyX
- BorderStyle = 1 'Fixed Single
- Caption = " Webpage Maker 2000"
- ClientHeight = 3825
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 8190
- Icon = "MainForm.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 3825
- ScaleWidth = 8190
- StartUpPosition = 2 'CenterScreen
- Begin VB.Frame Frame1
- Height = 2055
- Index = 1
- Left = 240
- TabIndex = 2
- Top = 1320
- Width = 2895
- Begin VB.OptionButton Option3
- Caption = "Specify name:"
- Height = 255
- Left = 240
- TabIndex = 13
- ToolTipText = "Type in a name"
- Top = 1200
- Width = 1335
- End
- Begin VB.OptionButton Option2
- Caption = "1.htm"
- Height = 255
- Left = 1680
- TabIndex = 12
- Top = 840
- Value = -1 'True
- Width = 855
- End
- Begin VB.OptionButton Option1
- Caption = "Page1.htm"
- Height = 255
- Left = 240
- TabIndex = 11
- Top = 840
- Width = 1095
- End
- Begin VB.TextBox txtPageName
- Height = 285
- Left = 240
- TabIndex = 10
- Top = 1560
- Width = 1335
- End
- Begin VB.Label Label17
- BackStyle = 0 'Transparent
- Caption = "The pages will have 1.htm after the name"
- Height = 675
- Left = 1680
- TabIndex = 30
- Top = 1320
- Width = 1260
- End
- Begin VB.Label Label3
- Caption = "The number 1 will increase up to the number of pages you create."
- Height = 435
- Left = 240
- TabIndex = 14
- Top = 240
- Width = 2415
- End
- End
- Begin ComctlLib.ProgressBar ProgressBar1
- Height = 225
- Left = 0
- TabIndex = 20
- Top = 3600
- Visible = 0 'False
- Width = 4815
- _ExtentX = 8493
- _ExtentY = 397
- _Version = 327682
- Appearance = 1
- End
- Begin ComctlLib.StatusBar StatusBar1
- Align = 2 'Align Bottom
- Height = 255
- Left = 0
- TabIndex = 31
- Top = 3570
- Width = 8190
- _ExtentX = 14446
- _ExtentY = 450
- SimpleText = ""
- _Version = 327682
- BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7}
- NumPanels = 1
- BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7}
- Object.Width = 8467
- MinWidth = 8467
- Object.Tag = ""
- EndProperty
- EndProperty
- End
- Begin VB.Frame Frame1
- Height = 2055
- Index = 3
- Left = 5160
- TabIndex = 22
- Top = 120
- Width = 2895
- Begin ComctlLib.Slider Slider2
- Height = 1215
- Left = 240
- TabIndex = 24
- Top = 720
- Width = 555
- _ExtentX = 979
- _ExtentY = 2143
- _Version = 327682
- Orientation = 1
- LargeChange = 1
- Min = 1
- Max = 3
- SelStart = 3
- TickStyle = 2
- Value = 3
- End
- Begin VB.Label Label16
- Caption = "Each file is 163 bytes in size."
- Height = 495
- Left = 1560
- TabIndex = 29
- Top = 1440
- Width = 1095
- End
- Begin VB.Label Label15
- AutoSize = -1 'True
- Caption = "- 10"
- Height = 195
- Left = 840
- TabIndex = 28
- Top = 1650
- Width = 270
- End
- Begin VB.Label Label14
- AutoSize = -1 'True
- Caption = "- 100"
- Height = 195
- Left = 840
- TabIndex = 27
- Top = 1220
- Width = 360
- End
- Begin VB.Label Label13
- AutoSize = -1 'True
- Caption = "- 2000"
- Height = 195
- Left = 840
- TabIndex = 26
- Top = 775
- Width = 450
- End
- Begin VB.Label Label12
- Caption = "Please select maximum number of webpages to make."
- Height = 495
- Left = 240
- TabIndex = 25
- Top = 240
- Width = 2175
- End
- End
- Begin VB.CommandButton cmdView
- Caption = "View"
- Height = 375
- Left = 3600
- MouseIcon = "MainForm.frx":0442
- MousePointer = 99 'Custom
- TabIndex = 15
- Top = 1560
- Width = 855
- End
- Begin VB.Frame Frame2
- Height = 2295
- Left = 3360
- TabIndex = 3
- Top = 1200
- Width = 1335
- Begin VB.CommandButton cmdClear
- Caption = "Clear"
- Height = 375
- Left = 240
- MouseIcon = "MainForm.frx":0594
- MousePointer = 99 'Custom
- TabIndex = 6
- Top = 1320
- Width = 855
- End
- Begin VB.CommandButton cmdCreate
- Caption = "Create"
- Height = 375
- Left = 240
- MouseIcon = "MainForm.frx":06E6
- MousePointer = 99 'Custom
- TabIndex = 5
- Top = 840
- Width = 855
- End
- Begin VB.CommandButton cmdExit
- Caption = "Exit"
- Height = 375
- Left = 240
- MouseIcon = "MainForm.frx":0838
- MousePointer = 99 'Custom
- TabIndex = 4
- Top = 1800
- Width = 855
- End
- Begin VB.Label Label11
- AutoSize = -1 'True
- Caption = "Menu"
- Height = 255
- Left = 450
- TabIndex = 23
- Top = 0
- Width = 495
- End
- End
- Begin VB.Frame Frame1
- Height = 2055
- Index = 2
- Left = 4800
- TabIndex = 1
- Top = 1440
- Width = 2895
- Begin VB.ComboBox Combo1
- Height = 315
- Left = 240
- Sorted = -1 'True
- Style = 2 'Dropdown List
- TabIndex = 19
- Top = 1560
- Width = 2535
- End
- Begin VB.TextBox txtFolder
- Height = 285
- Left = 240
- TabIndex = 18
- Top = 1080
- Width = 2535
- End
- Begin VB.CommandButton cmdSearch
- Caption = "Search"
- Height = 375
- Left = 1920
- MouseIcon = "MainForm.frx":098A
- MousePointer = 99 'Custom
- TabIndex = 17
- Top = 360
- Width = 855
- End
- Begin VB.Label Label10
- AutoSize = -1 'True
- Caption = "Pages will be stored in:"
- Height = 195
- Left = 240
- TabIndex = 21
- Top = 840
- Width = 1620
- End
- Begin VB.Label Label9
- Caption = "Where do you want to store the webpages?"
- Height = 495
- Left = 120
- TabIndex = 16
- Top = 240
- Width = 1695
- End
- End
- Begin ComctlLib.TabStrip TabStrip1
- Height = 2535
- Left = 120
- TabIndex = 0
- Top = 960
- WhatsThisHelpID = 2
- Width = 3135
- _ExtentX = 5530
- _ExtentY = 4471
- _Version = 327682
- BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7}
- NumTabs = 3
- BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7}
- Caption = "Names"
- Object.Tag = ""
- ImageVarType = 2
- EndProperty
- BeginProperty Tab2 {0713F341-850A-101B-AFC0-4210102A8DA7}
- Caption = "Folders"
- Object.Tag = ""
- ImageVarType = 2
- EndProperty
- BeginProperty Tab3 {0713F341-850A-101B-AFC0-4210102A8DA7}
- Caption = "Options"
- Object.Tag = ""
- ImageVarType = 2
- EndProperty
- EndProperty
- MousePointer = 99
- MouseIcon = "MainForm.frx":0ADC
- End
- Begin ComctlLib.Slider Slider1
- Height = 495
- Left = 120
- TabIndex = 7
- TabStop = 0 'False
- Top = 360
- Width = 4575
- _ExtentX = 8070
- _ExtentY = 873
- _Version = 327682
- LargeChange = 1
- SmallChange = 50
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Height = 195
- Left = 2880
- TabIndex = 9
- Top = 120
- Width = 165
- End
- Begin VB.Label Label1
- Caption = "Number of new webpages to make:"
- Height = 195
- Left = 240
- TabIndex = 8
- Top = 120
- Width = 2610
- End
- Attribute VB_Name = "CompanyX"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '#################################################'
- '## ## ----------------------------------- ## ##'
- '## ## Program name: Webpage Maker 2000 ## ##'
- '## ## Started in: October, 1999 ## ##'
- '## ## Author: David VanHook ## ##'
- '## ## ----------------------------------- ## ##'
- '#################################################'
- '----------------------VARIABLE SECTION-----------------------'
- Option Explicit
- Const Numtabs = 3 'Set the number of tabs
- Dim x As Integer 'For/Next loop variable
- Dim strPageType As String 'Name of pages to create
- Dim strFolders As String 'Frequently used folders
- 'Ini File Variables
- Dim File As String 'Path and name of INI file
- Dim NewNumber As Integer 'INI file return variable
- Dim numPages As String 'Number of pages to create
- Dim secTitle As String 'Section of INI file [Preferences]
- Dim subSecTitle As String 'Subsection of INI file
- '---------------------CLEAR ALL TEXTBOXES---------------------'
- Private Sub cmdClear_Click()
- txtPageName.Text = ""
- Slider1.Value = 0
- txtFolder.Text = ""
- End Sub
- '---------------------CREATE NEW WEBPAGES---------------------'
- Private Sub cmdCreate_Click()
- On Error GoTo oh_no
- x = 0
- Template.rtbDefault.LoadFile "Template.txt"
- Template.rtbDefault.Refresh
- If Slider1.Value = 0 Then
- Call MsgBox("How many new pages?", vbQuestion, "How many pages?")
- Exit Sub
- End If
- If Slider1.Value = 666 Then
- Call MsgBox("666 PAGES?", vbCritical, " - YOU ARE THE DEVIL -")
- Exit Sub
- End If
- '--------------------------------
- 'User selected to name the pages
- 'but didn't type in a name
- '--------------------------------
- If txtPageName = "" And Option3.Value = True Then
- Call MsgBox("Please select a Page Name.", vbCritical, "No Page Name")
- TabStrip1.Tabs(1).Selected = True
- Frame1(1).Visible = True
- Exit Sub
- End If
- '--------------------------------
- 'No folder was selected
- 'to store webpages in
- '--------------------------------
- If txtFolder.Text = "" Then
- Call MsgBox("Please select a Folder.", vbCritical, "No Folder selected")
- TabStrip1.Tabs(2).Selected = True
- Frame1(2).Visible = True
- Exit Sub
- End If
- If Left(txtFolder.Text, 3) <> "C:\" Then
- Call MsgBox("Invalid storage path specified.", vbCritical, " Folder does not exist")
- txtFolder.Text = ""
- Exit Sub
- End If
- 'Pages will be named: Page1.htm
- ' Page2.htm
- ' and so on...
- If Option1.Value = True Then
- strPageType = "Page"
- Else
-
- 'Pages will be named: 1.htm
- ' 2.htm
- ' and so on...
- If Option2.Value = True Then
- strPageType = ""
- Else
-
- 'Pages will be named: something1.htm
- ' something2.htm
- ' and so on...
- If Option3.Value = True Then
- strPageType = txtPageName.Text
- End If
-
- End If
-
- End If
- '---------------------------
- 'Create more than 1 webpage
- '---------------------------
- If Slider1.Value > 1 Then
- If MsgBox("Create " & Slider1.Value & " webpages? Are you sure?", vbQuestion + vbYesNo, " Really?") = vbYes Then
- ProgressBar1.Visible = True
- cmdCreate.MousePointer = 0
-
- For x = 1 To Slider1.Value
- ProgressBar1.Value = x
- Open txtFolder.Text & "\" & strPageType & x & ".htm" For Output As #2
- ProgressBar1.Max = Slider1.Value
- Print #2, Template.rtbDefault.Text
- Close #2
- Next x
-
- Else
- Exit Sub
- End If
- Else
-
- '---------------------------
- 'Create only 1 webpage
- '---------------------------
- If Slider1.Value = 1 Then
-
- If MsgBox("Create 1 webpage? Are you sure?", vbQuestion + vbYesNo, " Really?") = vbYes Then
- x = 1
- ProgressBar1.Value = x
- Open txtFolder.Text & "\" & strPageType & "1.htm" For Output As #2
- ProgressBar1.Visible = True
- ProgressBar1.Max = Slider1.Value
- Print #2, Template.rtbDefault.Text
- Close #2
- ProgressBar1.Visible = False
- Slider1.Visible = True
- Call MsgBox("New webpage complete!", vbExclamation, " Done")
- Exit Sub
- Else
- Exit Sub
- End If
-
- End If
-
-
- End If
- cmdCreate.MousePointer = 99
- ProgressBar1.Visible = False
- Call MsgBox("New webpages complete!", vbExclamation, " Done")
- Exit Sub
- oh_no:
- Call MsgBox("Invalid storage path specified.", vbCritical, " Folder does not exist")
- cmdCreate.MousePointer = 99
- txtFolder.Text = ""
- ProgressBar1.Visible = False
- TabStrip1.Tabs(2).Selected = True
- Frame1(2).Visible = True
- Exit Sub
- End Sub
- '------------------------EXIT PROGRAM-------------------------'
- Private Sub cmdExit_Click()
- '---------------------------------
- ' When exiting the program, save
- ' number of pages in the INI file
- '---------------------------------
- File = App.Path & "\wpm2000.ini" 'Path and file name of ini
- secTitle = "Preferences" 'Section name
- subSecTitle = "Number of Pages" 'Subsection
- numPages = Slider1.Max 'Value to save
- NewNumber = WritePrivateProfileString(secTitle, subSecTitle, numPages, File)
- Unload Folders
- Unload Template
- Unload Me
- End Sub
- '----------------FIND FOLDER TO STORE PAGES IN----------------'
- Private Sub cmdSearch_Click()
- Folders.Show
- End Sub
- '---------------------VIEW PAGE TEMPLATE----------------------'
- Private Sub cmdView_Click()
- Template.Show
- End Sub
- '------------------FREQUENTLY USED FOLDERS--------------------'
- Private Sub Combo1_Click()
- txtFolder.Text = Combo1.List(Combo1.ListIndex)
- End Sub
- '--------------------FORM UNLOAD SECTION----------------------'
- Private Sub Form_Unload(Cancel As Integer)
- Unload Template
- Unload Folders
- End Sub
- '-------------------SELECT NAME FOR PAGES---------------------'
- Private Sub Option3_Click()
- txtPageName.SetFocus
- End Sub
- '---------------SHOW NUMBER OF PAGES TO MAKE------------------'
- Private Sub Slider1_Change()
- Label2.Caption = Slider1.Value
- End Sub
- '---------------------UPDATE TICK MARKS-----------------------'
- Private Sub Slider1_Scroll()
- Slider1_Change
- End Sub
- Private Sub Slider2_Change()
- Select Case Slider2.Value
- Case Is = 1
- Slider1.Max = "2000"
- Slider1.TickFrequency = 100
- Slider1.Value = 2000
- Label2.Caption = "2000"
-
- Case Is = 2
- Slider1.Max = "100"
- Slider1.TickFrequency = 5
- Slider1.Value = 100
- Label2.Caption = "100"
-
- Case Is = 3
- Slider1.Max = "10"
- Slider1.TickFrequency = 1
- Slider1.Value = 10
- Label2.Caption = "10"
-
- End Select
-
- End Sub
- Private Sub Slider2_Click()
- Slider2_Change
- End Sub
- Private Sub Slider2_Scroll()
- Slider2_Change
- End Sub
- '----------------------TABSTRIP SECTION-----------------------'
- Private Sub TabStrip1_Click()
- 'This procedure determines which tab is selected
- 'and what tab container should be shown
- Static PrevTab As Integer
- PrevTab = Switch(PrevTab = 0, 1, PrevTab >= 1 And PrevTab <= Numtabs, PrevTab)
- Frame1(PrevTab).Visible = False
- Frame1(TabStrip1.SelectedItem.Index).Visible = True
- Frame1(TabStrip1.SelectedItem.Index).Refresh
- PrevTab = TabStrip1.SelectedItem.Index
- End Sub
- '---------------------FORM LOAD SECTION-----------------------'
- Private Sub Form_Load()
- On Error Resume Next
- '----------------------------------
- ' Set the height and width of form
- '----------------------------------
- CompanyX.Width = 4900
- CompanyX.Height = 4200
- For x = 1 To Numtabs 'Loop through the tabs
- With Frame1(x)
- .Left = TabStrip1.ClientLeft + 50
- .Top = TabStrip1.ClientTop + 50
- .Width = TabStrip1.ClientWidth - 100
- .Height = TabStrip1.ClientHeight - 100
- .Visible = False
- End With
- Next x
- TabStrip1.Tabs(1).Selected = True 'Form loads with first tab selected
- Frame1(1).Visible = True 'Show first container
- Label2.Caption = "0"
- '----------------
- ' Ini file values
- '----------------
- Dim Temp As String * 75
- Dim getnumPages As Long
- File = App.Path & "\wpm2000.ini"
- secTitle = "Preferences"
- subSecTitle = "Number of Pages"
- getnumPages = GetPrivateProfileString(secTitle, subSecTitle, File, Temp, Len(Temp), File)
- Slider1.Max = Temp
- Select Case Slider1.Max
- Case Is = "2000"
- Slider1.TickFrequency = 100
- Slider1.Value = 2000
- Label2.Caption = "2000"
- Slider2.Value = 1
-
- Case Is = "100"
- Slider1.TickFrequency = 5
- Slider1.Value = 100
- Label2.Caption = "100"
- Slider2.Value = 2
-
- Case Is = "10"
- Slider1.TickFrequency = 1
- Slider1.Value = 10
- Label2.Caption = "10"
- Slider2.Value = 3
-
- End Select
- File = App.Path & "\wpm2000.ini" 'Path and file name of ini
- secTitle = "Folders" 'Section name
- Temp = ""
- For x = 0 To 20
- subSecTitle = "Favorite Folders" & x 'Subsection
- getnumPages = GetPrivateProfileString(secTitle, subSecTitle, File, Temp, Len(Temp), File)
- If InStr(Temp, ".ini") Then Exit For
- Combo1.AddItem Temp
- If Temp = Combo1.List(x - 1) Then Exit For
- Next x
- Close #1
- End Sub
-